package charstream;

import java.io.*;

public class CharStreamDemo10 {
    public static void main(String[] args) throws IOException {
        // 字符缓冲流的特有功能
        // 符缓冲输入流BufferedReader: readLine 读一整行
        BufferedReader br = new BufferedReader(new FileReader("F:\\111\\a.txt"));

        // 读取数据
        // 在之前读不到数据，返回-1
        // readLine如果读不到数据返回nu11
        /*System.out.println(br.readLine());
        System.out.println(br.readLine());
        System.out.println(br.readLine());
        System.out.println(br.readLine());*/
        // 使用循环改进
        String line;
        while ((line = br.readLine()) != null) {
            System.out.println(line);
        }


    }
}
